package com.whccb.apps.office.document.at;

import com.actionsoft.bpms.commons.at.AbstExpression;
import com.actionsoft.bpms.commons.at.ExpressionContext;
import com.actionsoft.bpms.server.UserContext;
import com.whccb.apps.office.document.util.ODAppUtil;

public class GetOfficeDocumentTypeSqlByUserid extends AbstExpression {
	public GetOfficeDocumentTypeSqlByUserid(ExpressionContext atContext,
			String expressionValue) {
		super(atContext, expressionValue);
	}

	public String execute(String expression) {
		String result = "";
		String uid = getParameter(expression, 1).trim();// 用户帐号
		UserContext user = UserContext.fromUID(uid);
		if (user != null) {
			result = ODAppUtil.getUserDeptSqlInWhere(null, user
					.getDepartmentModel().getId());
		}
		return result;
	}
}
